<div class="panel panel-default panel-intro">

    <div style="z-index: 999 width:98%;padding:20px 40px 0" id="searchDiv" >
        <form action="{:url('order/order/index')}" methode="get">
            <div class="keyword-search">
                <input name="status" value="{$status}" type="text" style="display:none;">
                <div style="width:80px;display: inline-block;">商品Id:</div><input id="goodsId" name="goodsId" type="text" style="width: 200px;" placeholder="商品Id" value="{$params.goodsId}" />
                <div style="width:80px;display: inline-block;margin-left:10px">商品名称:</div><input id="goodsName" name="goodsName" type="text" style="width: 200px;margin-right:10px" placeholder="商品名称" value="{$params.goodsName}" />
                <div style="width:80px;display: inline-block;margin-left:10px">零件编号:</div><input  id="goodsNumber" name="goodsNumber" type="text" style="width: 200px;margin-right:10px" placeholder="零件编号" value="{$params.goodsNumber}" />
                <!--<br><br>-->
              
               
                <!--<br style="margin-top:30px;" />-->
                <div style="margin-top:20px;">
                      <div style="width:80px;display: inline-block;">买家昵称:</div><input id="name" name="name" type="text" style="width: 200px;" placeholder="买家昵称" value="{$params.name}" />
                     <div style="width:80px;display: inline-block;margin-left:10px">收货电话:</div><input id="phone" name="phone" type="text" style="width: 200px;margin-right:10px" placeholder="收货电话" value="{$params.phone}" />
                    <div style="width:80px;display: inline-block;margin-left:10px">订单编号:</div><input id="orderNumber" name="orderNumber" type="text" style="width: 200px;margin-right:10px" placeholder="订单编号" value="{$params.orderNumber}" />
              </div>
              <div style="margin-top:20px;">
                   <div style="width:80px;display: inline-block;">创建时间:</div><input id="createtime" name="createtime" type="date" style="width: 200px;color:#808080" placeholder="创建时间" value="{$params.createtime}" />
                <div style="width:80px;display:inline-block;margin-left:10px">结束时间:</div><input id="endtime" name="endtime" type="date"  style="width: 200px;color:#808080;margin-right:10px" placeholder="结束时间" value="{$params.endtime}" />
                <input type="submit" name="submit" value="搜索订单"/>
                <button type="submit" id="export" value="导出">导出</button>
            </div>
              </div>
        </form>
    </div>
    <div class="panel-body">
        <ul class="nav nav-tabs">
            {foreach name="orderStatusList" item="vo"}
                {if condition="$key != 3"}
                    <li class="{:$Think.get.status === (string)$key ? 'active' : ''}">
                        <a href="{:url('order/order/index')}?status={$key}&page=1&uid={$uid}"
                           data-value="{$key}">{$vo}</a>
                    </li>
                {/if}
            {/foreach}
        </ul>

        <div id="myTabContent" class="tab-content" >


            <div class="tab-pane fade active in" id="one">

                <div class="widget-body no-padding " style=" white-space: nowrap; overflow: hidden; overflow-x: scroll; -webkit-backface-visibility: hidden; -webkit-overflow-scrolling: touch;" >
                    <div id="toolbar" class="toolbar">
                        <a href="javascript:;" class="btn btn-default" style="font-size: 14px; color:dodgerblue;">
                            <span class="extend">
                                订单数量：<span id="sum">{$total}</span>
                            </span>
                        </a>
                        <a href="{:url('order/order/index')}" class="btn btn-default" style="font-size: 14px; color:dodgerblue;">
                            <span class="extend">
                                重置
                            </span>
                        </a>
                    </div>

                    <table id="table"
                           data-group-by-field="shape"
                           class="table table-striped table-bordered table-hover "
                           data-pagination="true"
                           style="text-align: right;overflow:scroll;"
                           >
                        <thead>
                            <tr>
                                <th data-field="dingdan" colspan="2" style="width:60px;text-align:center;">
                                    <!--<div class="th-inner" style="width:60px;text-align:center;">-->
                                        商品
                                    <!--</div>-->
                                </th>
                                <!--<th data-field="orderGoods.goods_name" style="width:60px;text-align:center;">商品名称</th>-->
                                <th data-field="orderGoods.goods_name" style="width:60px;text-align:center;">规格</th>
                                <th data-field="danjia" style="width:60px;text-align:center;">单价</th>
                                <th data-field="sum"    style="width:60px;text-align:center;">数量</th>
                                <th data-field="fukan"  style="width:60px;text-align:center;">实收</th>
                                <th data-field="majia"  style="width:80px;text-align:center;">买家</th>
                                <th data-field="danjia" style="width:120px;text-align:center;">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                        {foreach $list as $vo}
                            {if condition=" !empty($vo.order_goods) " }
                            <tr>
                                <td colspan="1" style="text-align: center;">
                                    订单单号： 
                                </td>
                                <td colspan="1" style="text-align: left;">
                                    {$vo.order_sn} &nbsp;&nbsp; 
                                </td>
                                <td colspan="1" style="text-align: center;">
                                     创建时间: 
                                </td>
                                <td colspan="1" style="text-align: left;">
                                     <!--{$vo.create_time|date="Y-m-d",###}-->
                                     {$vo.create_time|datetime}
                                </td>
                                <td colspan="1" style="text-align: center;">
                                    
                                    {if condition= "($vo.order_status == 2) || ($vo.order_status == 4)"}
                                        快递单号: 
                                    {/if}
                                </td>
                                <td colspan="3" style="text-align: center;">
                                    {if condition= "($vo.order_status == 2) || ($vo.order_status == 4)"}
                                          {$vo.delivery_id}
                                    {/if}
                                </td>
                                <!--<td colspan="2" style="text-align: center;">-->
                                <!--    {if condition= "($vo.order_status == 2) || ($vo.order_status == 4)"}-->
                                <!--        {$vo.delivery_id}-->
                                <!--    {/if}-->
                                <!--</td>-->
                            </tr>
                            {foreach $vo.order_goods as $v}
                                <tr >
                                    <td style="vertical-align:middle; width: 100px;">
                                        <div class="center-block" >
                                            <img style="width: 80px;height:80px;" class="img-responsive" src="{$v.goods_image}" />
                                        </div>
                                    </td>
                                    <td style="vertical-align:middle; width: 400px;white-space:pre-line;word-wrap:break-word;word-break:break-all;text-align:center;">
                                        <div>
                                            <a href="{:url('goods/goods/edit')}?ids={$v.goods_id}">{$v.goods_name}</a>
                                        </div>
                                    </td>

                                    <td style="vertical-align: middle;text-align: center;">
                                        <div>
                                            {$v.sku_name}
                                        </div>
                                    </td>
                                    <td style="vertical-align:middle;width: 20px;text-align: center;">
                                        <div>
                                            {$v.goods_price}
                                        </div>
                                    </td>
                                    <td style="vertical-align:middle;width: 20px;text-align: center;">
                                        <div>
                                            {$v.goods_num}
                                        </div>
                                    </td>
                                    <td style="vertical-align:middle;width:20px;text-align: center;">
                                        <div>
                                            {$vo.goods_pay_price}
                                        </div>
                                    </td>
                                    <td style="vertical-align:middle; width: 60px;text-align: center;" >
                                        <div>
                                            <span>
                                               {$vo.name}
                                            </span>
                                            <br>
                                        </div>
                                    </td>
                                    <td style="text-align:center;vertical-align:middle;padding-top:20px">
                                    <div>
                                        <a class="btn-dialog btn btn-xs btn-primary" data-area=["100%","100%"] style="background-color: #18bc9c;" title="订单详情" href="{:url('order/order/show')}?ids={$vo.id}&status={$status}" >订单详情</a>
                                    </div>
                                    &nbsp;
                                    {if condition ="$vo.order_status == 0"}
                                        <div>
                                            <a class="btn-dialog btn btn-xs btn-primary" data-area=["100%","100%"] style="background-color: #f75444;" title="修改价格" href="{:url('order/order/userprice')}?id={$vo.id}">
                                                <li class="fa fa-map-signs" style="display: none"></li>修改价格
                                            </a>
                                        </div>
                                        &nbsp;
                                    {/if}

                                    {if condition="$vo.order_status == 1"}
                                    <div><a class="btn-dialog btn btn-xs btn-primary" data-area=["100%","100%"] title="发货" style="background-color: #18bc9c;" href="{:url('order/order/autodelivery')}?ids={$vo.id}">发货</a></div>&nbsp;
                                    {/if}
                                    {if condition= "($vo.order_status == 2) || ($vo.order_status == 4)|| ($vo.order_status == 5) || ($vo.order_status == 6 && $vo.shipping_status == 1)"}
                                        <div>
                                            <a class="btn-dialog btn btn-xs btn-primary" data-area=["100%","100%"] style="background-color: #f75444;" title="物流" href="{:url('order/courier/courierselect')}?ids={$vo.id}">
                                                <li class="fa fa-map-signs" style="display: none"></li>  查看物流
                                            </a>
                                        </div>
                                        &nbsp;
                                    {/if}

                                    
                                    
                                    {if condition= "($vo.order_status == 2)"}
                                    <div>
                                        <a class="btn-dialog btn btn-xs btn-primary" href="order/order/extended" style="background-color: #18bc9c;" data-area=["100%","100%"] title="物流">
                                            <li class="fa fa-map-signs" style="display: none"></li> 延长收货
                                        </a>
                                    </div>
                                    &nbsp;
                                    {/if}
                                    
                                    {if condition="$vo.order_status <= 1"}
                                    <div>
                                        <a href="javascript:;" class="downid btn btn-xs btn-primary" data-value="{$vo.id}">关闭订单</a>
                                    </div>
                                    &nbsp;
                                    {/if}
                                    
                                    {if condition="($vo.order_status == 5)"}
                                        {if condition="$vo.pay_status == 2"}
                                        <div>
                                        <a class="btn btn-xs btn-primary" style="background-color: #18bc9c;" href="javascript:;">退款成功</a>
                                        </div>
                                        {elseif condition="$vo.pay_status == 3"}
                                        <div>
                                        <a class="btn btn-xs btn-primary" style="background-color: #f75444;" href="javascript:;">已拒绝</a>
                                        </div>
                                        {else/}
                                        <div>
                                        <a class="btn btn-xs btn-primary tuikuan" style="background-color: #f75444;" href="javascript:;" data-value="{$vo.id}">确认退款</a>
                                        </div>
                                        &nbsp;
                                        <!--<div>-->
                                        <!--<a class="btn btn-xs btn-primary" style="background-color: #f75444;" href="javascript:;">退款中</a>-->
                                        <!--</div>-->
                                        <div>
                                        <a class="btn btn-xs btn-primary jujuetuikuan" style="background-color: #18bc9c;" href="javascript:;" data-value="{$vo.id}">拒绝退款</a>
                                        </div>
                                        {/if}
                                    &nbsp;
                                    {/if}
                                    {if condition="($vo.order_status == 6)"}
                                        {if condition="$vo.pay_status == 2"}
                                        <div>
                                        <a class="btn btn-xs btn-primary" style="background-color: #f75444;" href="javascript:;">退款成功</a>
                                        </div>
                                        {/if}
                                    &nbsp;
                                    {/if}
                                    
                                    {if condition="($vo.order_status == 6 && $vo.pay_status == 1)"}
                                    <div>
                                        <a class="btn btn-xs btn-primary" style="background-color: #18bc9c;" href="javascript:;">已付款</a>
                                    </div>
                                    &nbsp;
                                    {/if}
                                    {if condition="($vo.pay_status == 0 && $vo.order_status == 6)"}
                                    <div>
                                        <a class="btn btn-xs btn-primary" style="background-color: #f75444;" href="javascript:;">未付款</a>
                                    </div>
                                    &nbsp;
                                    {/if}
                                </td>
<!--                                    <td style="vertical-align:middle; text-align:right;">-->
<!--                                        {if condition ="$vo.order_status <= 1"}-->
<!--                                            <span><a href="{:url('order/order/orderGoodsshut')}?id={$v.id}">关闭订单</a></span>-->
<!--                                        {/if}-->
<!--                                    </td>-->
                                </tr>
                            {/foreach}
                        {/if}
                        {/foreach}
                        </tbody>
                    </table>
                    <div class="f_page">
                        {$row->render();}
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
